package com.qdlc.p2p.dal.dto;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.qdlc.p2p.common.constant.Global;

/**
 * 活动方案实体类
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "activity_plan")
public class ActivityPlan {

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 中文名字 */
    private String name;

    /** 英文名字==代号 */
    private String nid;

    /** 状态  0代表关闭  1代表开启 */
    private int status;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "uprate_rule")
    @NotFound(action = NotFoundAction.IGNORE)
    private RateRule rateRule;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "experience_rule")
    @NotFound(action = NotFoundAction.IGNORE)
    private ExperienceRule experienceRule;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "red_envelope_rule")
    @NotFound(action = NotFoundAction.IGNORE)
    private RedEnvelope redEnvelopeRule;

    /** 附加规则 */
    private String additionalRule;

    /** 活动开始时间 */
    private Date startTime;

    /** 动结束时间 */
    private Date endTime;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNid() {
        return nid;
    }

    public void setNid(String nid) {
        this.nid = nid;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public RedEnvelope getRedEnvelopeRule() {
        return redEnvelopeRule;
    }

    public void setRedEnvelopeRule(RedEnvelope redEnvelopeRule) {
        this.redEnvelopeRule = redEnvelopeRule;
    }

    public ExperienceRule getExperienceRule() {
        return experienceRule;
    }

    public void setExperienceRule(ExperienceRule experienceRule) {
        this.experienceRule = experienceRule;
    }

    /*public int getUprateRule() {
        return uprateRule;
    }
    public void setUprateRule(int uprateRule) {
        this.uprateRule = uprateRule;
    }*/
    public String getAdditionalRule() {
        return additionalRule;
    }

    public void setAdditionalRule(String additionalRule) {
        this.additionalRule = additionalRule;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public RateRule getRateRule() {
        return rateRule;
    }

    public void setRateRule(RateRule rateRule) {
        this.rateRule = rateRule;
    }


}
